FROM golang:latest

ADD sources.list /etc/apt/

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

ENV GOPROXY https://goproxy.cn

WORKDIR /www

COPY ./ /www

RUN apt-get update && apt-get install net-tools

RUN go mod download

RUN go get github.com/githubnemo/CompileDaemon

ENTRYPOINT CompileDaemon --build="go build main.go" --command=./main